<main>
  <div class="tab-content">
    <h3  style="font-weight: normal">修改密码</h3>
    <form  #securityForm="ngForm" >
      <div class="tab-content user-form">
        <div class="input-container">
          <label class="key" >旧密码:</label>
          <input type="password" name="password" required [(ngModel)] ="updateUser.mima" placeholder="旧密码">
          <mat-error *ngIf="messages.password">{{ messages.password }}</mat-error>
        </div>

        <div class="input-container">
          <label class="key" >新密码:</label>
          <input  type="password" placeholder="密码" [(ngModel)] ="updateUser.address" name="newPassword"
                  required pattern="(?!^\d+$)(?!^[a-zA-Z]+$).{6,}">
          <mat-error *ngIf="messages.newPassword">{{ messages.newPassword }}</mat-error>
        </div>

        <div class="input-container">
          <label class="key" >确定密码:</label>
          <input  type="password" placeholder="确认密码"  [pattern]="'^'+updateUser.address+'$'" required [(ngModel)] ="updateUser.confirmPassword" name="confirmPassword">
          <mat-error *ngIf="messages.confirmPassword">{{ messages.confirmPassword}}</mat-error>
        </div>

        <button mat-button class="button  dark-green" (click)="onSubmit()" >保存</button>
      </div>
    </form>
  </div>
</main>
